package com.yunshipei.utils;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import java.util.List;

/**
 * Created by cike on 16/10/21.
 */

public class PackageUtil {

    public static boolean isInstall(Context context, String packageName) {
        PackageManager packageManager = context.getPackageManager();
        List<PackageInfo> packageInfos = packageManager.getInstalledPackages(0);
        for (PackageInfo p : packageInfos) {
            if (p.packageName.equalsIgnoreCase(packageName))
                return true;
        }
        return false;
    }
}
